// $Id: example.cpp 9 2008-09-30 03:21:47Z rodlima $

#include "example.h"
#include "metainfo.h"
#include "db.h"

using namespace orm;

metainfo<Discipline> Discipline::meta = /*{{{*/
    metainfo<Discipline>("discipline")
        .ident("iddiscipline")
        .member(&Discipline::name, "name")
        .member(&Discipline::enabled, "enabled")
        .member(&Discipline::priority, "priority")
        .member(&Discipline::creation, "creation")
        .member(&Discipline::altname, "altname")
        .member(&Discipline::classes, "idclass", &Class::discipline);
/*}}}*/

metainfo<Class> Class::meta = /*{{{*/
    metainfo<Class>("class")
        .ident("idclass")
        .member(&Class::name, "name")
        .member(&Class::discipline, "iddiscipline", &Discipline::classes)
        .member(&Class::students, "idstudent", &Student::classes)
        .member(&Class::planned_evaluations, "idplanned_evaluation", &PlannedEvaluation::class_);
/*}}}*/

metainfo<Address> Address::meta = /*{{{*/
    metainfo<Address>("address")
        .ident("idaddress")
        .member(&Address::street, "street")
        .member(&Address::student, "idstudent", &Student::address);
/*}}}*/

metainfo<Student> Student::meta = /*{{{*/
    metainfo<Student>("student")
        .ident("idstudent")
        .member(&Student::name, "name")
        .member(&Student::classes, "idclass", &Class::students)
        .member(&Student::mother, "idmother", &Relative::children)
        .member(&Student::father, "idfather", &Relative::children)
        .member(&Student::address, "idaddress", &Address::student)
        .member(&Student::aunts, "idaunt")
        .member(&Student::uncles, "iduncle");
/*}}}*/

metainfo<Relative> Relative::meta = /*{{{*/
    metainfo<Relative>("relative")
        .ident("idrelative")
        .member(&Relative::name, "name")
        .member(&Relative::children, "idchild", &Student::father, &Student::mother);
/*}}}*/

metainfo<PlannedEvaluation> PlannedEvaluation::meta = /*{{{*/
    metainfo<PlannedEvaluation>("planned_evaluation")
        .ident("idplanned_evaluation")
        .member(&PlannedEvaluation::date, "date")
        .member(&PlannedEvaluation::class_, "idclass", &Class::planned_evaluations)
        .member(&PlannedEvaluation::evaluation, "idevaluation", &Evaluation::planned_evaluation);
/*}}}*/

metainfo<Evaluation> Evaluation::meta = /*{{{*/
    metainfo<Evaluation>("evaluation")
        .ident("idevaluation")
        .member(&Evaluation::date, "date")
        .member(&Evaluation::planned_evaluation, "idplanned_evaluation", &PlannedEvaluation::evaluation)
        .member(&Evaluation::grades, "idgrade", &Grade::evaluation);
/*}}}*/

metainfo<Grade> Grade::meta = /*{{{*/
    metainfo<Grade>("grade")
        .ident("idgrade")
        .member(&Grade::student, "idstudent")
        .member(&Grade::evaluation, "idevaluation", &Evaluation::grades)
        .member(&Grade::value, "value");
/*}}}*/

